#include<stdio.h>
int main()
{   
	int i,num=0,j=0,h=0,nu=0,n=0,a[1000],t=0,b=0;
	scanf("%d",&n);
 /*	printf("%d\n",n);*/
	for (i=0;i<n;i++) 
	{
		a[i]=0;
	/*	printf("%d",a[i]);*/
	}
	/*      printf("%d\n",n);*/
	/*   printf("%d\n",n);*/
	for (i=0;i<n;i++)  
	{
		scanf("%d",&a[i]);
	/*	printf("%d",a[i]);*/
	}

	  for ( i=0;i<n;i++) {
	      b = a[i];
	      t = b;
	      b%=2;
	      switch (b)
{
              case 1:
              num++;
              j+=t;
              break;
              case 0:
              nu++;
              h+=t;
              break;
}
}
             /*if ( b=1) {
	      num++;
	      j+=t; }
	      else if (b=0) {
	      nu++;
	      h+=t; }
	      }
*/
	      printf("%d\n",j);
	      printf("%d\n",num);
	      printf("%d\n",h);
	      printf("%d\n",nu);
	return 0;

}
